import request from '@/utils/request'

// 获取企业的部门列表数据
export const reqDepartments = () => {
  return request({
    url: '/company/department'
  })
}

// 根据id删除部门
export const reqDelDepartment = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

// 添加部门
export const reqAddDepartment = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 编辑部门
export function reqGetDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 更新部门
export function reqUpdateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
